package com.ibs.hadoop.hbase.service.complaint.impl;

import java.util.List;

import com.ibs.hadoop.hbase.bean.AttachBean;
import com.ibs.hadoop.hbase.bean.QueryBean;
import com.ibs.hadoop.hbase.bean.UseComplaintBaseClass;
import com.ibs.hadoop.hbase.dao.impl.AttachDaoImpl;
import com.ibs.hadoop.hbase.service.complaint.UserComplaintDataQuery;

/**
 * 用户投诉查询
* 源文件名：UserComplaintAttachQuery.java
* 文件版本：1.0.0
* 创建作者：Think
* 创建日期：2016年10月31日
* 修改作者：Think
* 修改日期：2016年10月31日
* 文件描述：TODO
* 版权所有：Copyright 2016 zjhz, Inc. All Rights Reserved.
*/
public class UserComplaintAttachQuery implements UserComplaintDataQuery {

    private static final UserComplaintAttachQuery INSTANCE = new UserComplaintAttachQuery();

    public static UserComplaintDataQuery getInstance() {
        return INSTANCE;
    }

    @Override
    public List<UseComplaintBaseClass> query(QueryBean query) {
        return AttachDaoImpl.getInstance().query(query);

    }

    @Override
    public String parseLine(UseComplaintBaseClass params) {
        AttachBean param = (AttachBean) params;

        StringBuilder result = new StringBuilder();

        result.append("Tac").append(":").append(param.getTac()).append(",");
        result.append("Frame").append(":").append(param.getFrame()).append(",");
        result.append("Ttime").append(":").append(param.getTtime()).append(",");
        result.append("LastFrame").append(":").append(param.getLastFrame()).append(",");
        result.append("EnbId").append(":").append(param.getEnbId()).append(",");
        result.append("Ci").append(":").append(param.getCi()).append(",");
        result.append("Imsi").append(":").append(param.getImsi()).append(",");
        result.append("Imei").append(":").append(param.getImei()).append(",");
        result.append("MTmsi").append(":").append(param.getMTmsi()).append(",");
        result.append("Mmecode").append(":").append(param.getMmecode()).append(",");
        result.append("NewMTmsi").append(":").append(param.getNewMTmsi()).append(",");
        result.append("NewMmecode").append(":").append(param.getNewMmecode()).append(",");
        result.append("Success").append(":").append(param.getSuccess()).append(",");
        result.append("FailureCause").append(":").append(param.getFailureCause()).append(",");
        result.append("ResponseTime").append(":").append(param.getResponseTime()).append(",");
        result.append("FailureMsg").append(":").append(param.getFailureMsg()).append(",");
        result.append("RecordFileIndex").append(":").append(param.getRecordFileIndex()).append(",");
        result.append("LastFileindex").append(":").append(param.getLastFileindex()).append(",");
        result.append("MobileType").append(":").append(param.getMobileType()).append(",");
        result.append("MobileBrand").append(":").append(param.getMobileBrand()).append(",");
        result.append("EnbIp").append(":").append(param.getEnbIp()).append(",");
        result.append("MmeIp").append(":").append(param.getMmeIp()).append(",");
        result.append("Enb").append(":").append(param.getEnb()).append(",");
        result.append("Mme").append(":").append(param.getMme()).append(",");
        result.append("AuthreqDelay").append(":").append(param.getAuthreqDelay()).append(",");
        result.append("AuthresDelay").append(":").append(param.getAuthresDelay()).append(",");
        result.append("AttachCmp").append(":").append(param.getAttachCmp()).append(",");
        result.append("DelayCn").append(":").append(param.getDelayCn()).append(",");
        result.append("DelayRadio").append(":").append(param.getDelayRadio()).append(",");
        result.append("Lasttime").append(":").append(param.getLasttime()).append(",");
        result.append("WifiFlag").append(":").append(param.getWifiFlag()).append(",");
        result.append("ProduceDate").append(":").append(param.getProduceDate()).append(",");
        result.append("MpPrice").append(":").append(param.getMpPrice()).append(",");
        result.append("OsImei").append(":").append(param.getOsImei()).append(",");
        result.append("AttachType").append(":").append(param.getAttachType()).append(",");
        result.append("AttResult").append(":").append(param.getAttResult()).append(",");
        result.append("EstablishCause").append(":").append(param.getEstablishCause()).append(",");
        result.append("MmeUeId").append(":").append(param.getMmeUeId()).append(",");
        result.append("AlgId").append(":").append(param.getAlgId()).append(",");
        result.append("Rand").append(":").append(param.getRand()).append(",");
        result.append("UlTeid").append(":").append(param.getUlTeid()).append(",");
        result.append("DlTeid").append(":").append(param.getDlTeid()).append(",");
        result.append("EnbTransaddr").append(":").append(param.getEnbTransaddr()).append(",");
        result.append("UserIpValue").append(":").append(param.getUserIpValue()).append(",");
        result.append("CsfbCapability").append(":").append(param.getCsfbCapability()).append(",");
        result.append("SGwIp").append(":").append(param.getSGwIp()).append(",");
        result.append("TmsiCs").append(":").append(param.getTmsiCs()).append(",");
        result.append("IbsId").append(":").append(param.getIbsId()).append(",");
        result.append("ZoneId").append(":").append(param.getZoneId()).append(",");
        result.append("ErabReqDelay").append(":").append(param.getErabReqDelay()).append(",");
        result.append("ErabResDelay").append(":").append(param.getErabResDelay()).append(",");
        result.append("ERabCause").append(":").append(param.getERabCause()).append(",");
        result.append("RatType").append(":").append(param.getRatType()).append(",");
        result.append("VoicePrefered").append(":").append(param.getVoicePrefered()).append(",");

        return result.toString();
    }

}
